package com.jz.netthings.application.heatseal.controller;


import com.jz.netthings.application.heatseal.bean.BoxConf;
import com.jz.netthings.application.heatseal.service.BoxConfService;
import com.jz.netthings.support.SimpleCoreResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.swing.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lzf
 * @since 2019-03-25
 */
@RestController
@RequestMapping("adscm/application/heatSeal/boxConf")
public class BoxConfController {
@Autowired
    private BoxConfService boxConfService;
    @RequestMapping("/insert")
    public SimpleCoreResponse insert(@RequestBody BoxConf boxConf){
        return new SimpleCoreResponse("200","新增成功",boxConfService.insert(boxConf));
    }

    @RequestMapping("/delete")
    public SimpleCoreResponse delete(@RequestParam("id") Integer id){
        return new SimpleCoreResponse("200","删除成功",boxConfService.deleteById(id));
    }
    @RequestMapping("/update")
    public SimpleCoreResponse update(@RequestBody BoxConf boxConf){
        return new SimpleCoreResponse("200","修改成功",boxConfService.updateById(boxConf));
    }
    @RequestMapping("/query")
    public SimpleCoreResponse query(){

        return new SimpleCoreResponse("200","查询成功",boxConfService.selectList(null));
    }
}

